50% off: Unlimited data and AI learning.
The Learning Leader's Guide to AI Literacy

DistributionUtils (version 0.6-1)

Sample Moments: Sample Skewness and Kurtosis

Description

Computes the sample skewness and sample kurtosis.

Usage

skewness(x, na.rm = FALSE)
kurtosis(x, na.rm = FALSE)

Value

The skewness or kurtosis of x.

Arguments

x

A numeric vector containing the values whose skewness or kurtosis is to be computed.

na.rm

A logical value indicating whether NA values should be stripped before the computation proceeds.

Author

Evgenia Dimitriadou, Kurt Hornik, Friedrich Leisch, David Meyer, and Andreas Weingessel

Details

If N=length(x), then the skewness of x is defined as N1sd(x)3i(ximean(x))3.

If N=length(x), then the kurtosis of x is defined as N1sd(x)4i(ximean(x))43.

Examples

Run this code
x <- rnorm(100)
skewness(x)
kurtosis(x)

Run the code above in your browser using DataLab